export function restoreIpAddresses(s: string): string[] {
    const result: string[] = [];
    const length = s.length;
    if (length < 4 || length > 12) {
        return result;
    }



    return result;
};

function dfs (s: string, len: number, splitCount: number, begin: number, path: string[], result: string[]) {
    // 遍历结束时，将 path 加入 result
    if (len === begin) {
        if (splitCount === 4) {
            result.push(path.join('.'));
        }
        return;
    }

    
}

function isIPSegment (s: string, left: number, right: number) {
    const length = right - left + 1;

    // 长度大于1时，开头不能为 0
    if (length > 1 && s[left] === '0') return false;

    // 转成 int
    const num = parseInt(s.substring(left, right+1));
    if (num > 225) return false;
    return true;
}